#pragma once
#include<string>
#include<iomanip>
#include<iostream>
#include<istream>
#include<ostream>
#include<fstream>
#include<sstream>
#include<vector>
#include"Vehicle.h"
#include"Repaired.h"

using namespace std;
class VehicleRegister
{
private:
	string name;
	vector<Vehicle> v;
	vector<Repaired> r;

	int id;

public:
	bool quit;
	
public:
	VehicleRegister();
	VehicleRegister(string n, int r);

	bool Quit() { return quit;}

	void AddObject(Vehicle V);
	void DeleteObject(int index);
	int SearchObject(string t);
	string List();
	void RepairObject(Repaired R);

	

	void WriteToFile(string filename);
	void ReadFromFile(string filename);

	double CalculateStorageValue(Vehicle V);

	friend ostream & operator << (ostream &out, VehicleRegister & op);
	friend istream & operator >>(istream &sin, VehicleRegister &op);


	string GetName(){ return name;}
	void SetName(string n) { name=n;}

	int GetId(){ return id;}
	void SetId(int r) { id=r;}
};

